package com.ibbt.musicplayer.client.audio;

import com.codelathe.gwt.client.Sound;
import com.codelathe.gwt.client.SoundManager;

public class MySoundManager {
	/**************** OBJECTEN *******************/
	
	//Singleton-object
	private static final MySoundManager INSTANCE = new MySoundManager(); 
	
	//CodeLathe GWT Sound Manager Objecten
	private SoundManager sm_obj;
	
	/**************** CONSTRUCTOR *******************/
	
	//getInstance functie om singleton object te verkrijgen
	public static MySoundManager getInstance() {
		return INSTANCE;
	}
	
	//private constructor
	private MySoundManager(){
		//initialiseren GWT Soundmanager
		sm_obj = SoundManager.createInstance();
	}
	
	/**************** METHODES *******************/
	
	public void play_stream(String id, String url){
		SoundManager.setStreamMode(true);
		Sound sound = sm_obj.createSound(id, url);
		sound.play();
	}
	


}
